package com.etc.reflectdemo;

import com.etc.reflectdemo.entity.Book;

import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;

/**
 * @author: knowno
 * @create: 2024-09-18 16:04
 * @Version 1.0
 **/
public class TestBook {
    public static void main(String[] args) throws IntrospectionException, InstantiationException, IllegalAccessException, InvocationTargetException {


        String sql = "select  book.isbn,book.typeid,book.bookname,bt.typeName from  tb_bookinfo  book inner join tb_booktype bt on book.typeid=bt.id";

        List<Book> list = DBUtil2.exQuery(sql, Book.class);

        for (Book b : list) {
            System.out.println(b.getBookname() + " - "+b.getBookType().getTypeName());
        }


    }
}
